<template>
  <div>
    <a-card :bordered="false">
      <f-search-form @searchHandler="searchHandler">
        <f-search-form-item label="店铺名称" name="shopName"/>
        <f-search-form-item label="付款日期" name="rangeDate" type="range" slot="advanced"/>
      </f-search-form>
      <f-table ref="table" size="default" rowKey="couponId" :exportBtn="true" :columns="columns" :multiple="false" :operator="operator" :params="queryParam" :api="api.settle">
        <span slot="action" slot-scope="text, record">
          <template>
             <a @click="$refs.orderInfoDrawer.handleShow(record)">明细</a>
            <a-divider type="vertical"/>
          </template>
          <a-dropdown>
            <a class="ant-dropdown-link">
              更多 <a-icon type="down"/>
            </a>
            <a-menu slot="overlay">
              <a-menu-item v-if="$auth('table.delete')">
                <a href="javascript:;" @click="$refs.table.tableExport()">导出</a>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </f-table>
    </a-card>
    <settle-order-info-drawer ref="orderInfoDrawer"></settle-order-info-drawer>
  </div>
</template>
<script>
  import SettleOrderInfoDrawer from './orderInfo/settle_orderinfo_drawer'

  export default {
    name: 'TableList',
    components: { SettleOrderInfoDrawer },
    data() {
      let me = this
      return {
        //列表初始化查询参数
        queryParam: {},
        // 表头
        columns: [
          {
            title: '店铺名称',
            dataIndex: 'shopName'
          },
          {
            title: '店铺分类',
            dataIndex: 'typeName'
          },
          {
            title: '订单金额',
            dataIndex: 'totalAmount',
            isStatistics:true,
            align: 'center'
          },
          {
            title: '运费',
            dataIndex: 'freightAmount',
            isStatistics:true,
            align: 'center'
          },
          {
            title: '优惠券金额',
            align: 'center',
            isStatistics:true,
            dataIndex: 'couponAmount'
          },
          {
            title: '折扣金额',
            dataIndex: 'discountAmount',
            align: 'center'
          },
          {
            title: '付款金额',
            dataIndex: 'payAmount',
            isStatistics:true,
            align: 'center'
          },
          {
            title: '费率',
            dataIndex: 'typeRate'
          },
          {
            title: '手续费',
            isStatistics:true,
            dataIndex: 'rateFee'
          },
          {
            title: '提现金额',
            isStatistics:true,
            dataIndex: 'cashOutFee'
          },
          {
            title: '操作',
            dataIndex: 'action',
            scopedSlots: { customRender: 'action' }
          }
        ],
        //操作按钮
        operator: []
      }
    },
    created() {

    },
    methods: {
      searchHandler(params) {
        this.$refs.table.refresh(true, params)
      }
    }

  }
</script>
